feat: add a builder() method to HttpsConnector#259
Merged
cpu merged 1 commit intorustls:mainfrom Mar 20, 2024
Merged
Conversation
be05a64 to
956111f
Compare
Contributor
Author
|
Not quite sure how to make rustdoc link those references correctly? 😕 |
Member
|
See #260 (comment). |
Contributor
Author
|
This PR could just as well be completely unrelated from the other two. This is not necessary but is a common API idom for builder APIs in Rust. |
djc
approved these changes
Mar 20, 2024
Member
djc
left a comment
There was a problem hiding this comment.
Fair point! I think this is a good change.
Tiny nit: as a constructor of sorts (even if indirectly), I would prefer we move builder() before enforce_https().
cpu
approved these changes
Mar 20, 2024
Member
cpu
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me modulo the CI docs failure getting fixed.
Not quite sure how to make rustdoc link those references correctly?
I think this diff will do the trick:
diff --git a/src/connector.rs b/src/connector.rs
index 103dede..5b975e0 100644
--- a/src/connector.rs
+++ b/src/connector.rs
@@ -35,9 +35,9 @@ impl<T> HttpsConnector<T> {
self.force_https = true;
}
- /// Creates a [`builder::HttpsConnectorBuilder`] to configure a `HttpsConnector`.
+ /// Creates a [`crate::HttpsConnectorBuilder`] to configure a `HttpsConnector`.
///
- /// This is the same as [`builder::HttpsConnectorBuilder::new()`].
+ /// This is the same as [`crate::HttpsConnectorBuilder::new()`].
pub fn builder() -> builder::ConnectorBuilder<builder::WantsTlsConfig> {
builder::ConnectorBuilder::new()
}It's become very idiomatic to have the builder api be accessed this way.
956111f to
1f9db89
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's become very idiomatic to have the builder api be accessed this way.